const app = new Vue({
  el: '#app',
  data: {
    activeIndex: 0,
    left: [],
    right: []
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const { data } = await axios.get('/category/list')
      // console.log(data)
      const { data: res } = data
      // console.log(res)
      // 左边栏
      this.left = res.list
      // 右边栏
      this.right = this.left[this.activeIndex].children
    },
    change() {
      // this.right = this.left[this.activeIndex].children
      this.getList()
    }
  }
})
